{% if pagination.pages > 1 %}
<nav aria-label="Page navigation" class="mt-4">
    <ul class="pagination justify-content-center">
        <li class="page-item {% if not pagination.has_prev %}disabled{% endif %}">
            <a class="page-link" href="{% if pagination.has_prev %}{{ url_for(request.endpoint, page=pagination.prev_num) }}{% else %}#{% endif %}">
                上一页
            </a>
        </li>
        
        {% for page in pagination.iter_pages(left_edge=2, left_current=2, right_current=3, right_edge=2) %}
            {% if page %}
                <li class="page-item {% if page == pagination.page %}active{% endif %}">
                    <a class="page-link" href="{{ url_for(request.endpoint, page=page) }}">{{ page }}</a>
                </li>
            {% else %}
                <li class="page-item disabled">
                    <span class="page-link">...</span>
                </li>
            {% endif %}
        {% endfor %}
        
        <li class="page-item {% if not pagination.has_next %}disabled{% endif %}">
            <a class="page-link" href="{% if pagination.has_next %}{{ url_for(request.endpoint, page=pagination.next_num) }}{% else %}#{% endif %}">
                下一页
            </a>
        </li>
    </ul>
</nav>
{% endif %} 